package de.szut.util;

/**
 * Wrapper for checking if a value is in a certain range
 * @author Marc Huisinga
 *
 */
public class RangeCheck {
	
	/**
	 * Checks if the value is in the specified range inclusively (returns true if value equals min or max) 
	 * @param min - Minimum
	 * @param max - Maximum
	 * @param value - Value to be checked
	 * @return result
	 */
	public static boolean isInRangeInclusive(int min, int max, int value) {
		return value>=min && value<=max;
	}
	
	/**
	 * Checks if the value is in the specified range exclusively (returns false if value equals min or max) 
	 * @param min - Minimum
	 * @param max - Maximum
	 * @param value - Value to be checked
	 * @return result
	 */
	public static boolean isInRangeExclusive(int min, int max, int value) {
		return value>min && value<max;
	}
	
	/**
	 * Checks if the value is in the specified range with min being inclusive and max being exclusive (returns true if value equals min but equals false if value equals max) 
	 * @param min - Minimum
	 * @param max - Maximum
	 * @param value - Value to be checked
	 * @return result
	 */
	public static boolean isInRange(int min, int max, int value) {
		return value>=min && value<max;
	}
	
	private RangeCheck() {}
}
